

<%@ page import="eudjok.Exemplo" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'exemplo.label', default: 'Exemplo')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${exemploInstance}">
            <div class="errors">
                <g:renderErrors bean="${exemploInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${exemploInstance?.id}" />
                <g:hiddenField name="version" value="${exemploInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="avaliacoes"><g:message code="exemplo.avaliacoes.label" default="Avaliacoes" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'avaliacoes', 'errors')}">
                                    <g:select name="avaliacoes" from="${eudjok.Avaliacao.list()}" multiple="yes" optionKey="id" size="5" value="${exemploInstance?.avaliacoes*.id}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="chato"><g:message code="exemplo.chato.label" default="Chato" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'chato', 'errors')}">
                                    <g:textField name="chato" value="${fieldValue(bean: exemploInstance, field: 'chato')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="comentarios"><g:message code="exemplo.comentarios.label" default="Comentarios" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'comentarios', 'errors')}">
                                    
<ul>
<g:each in="${exemploInstance?.comentarios?}" var="c">
    <li><g:link controller="comentario" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="comentario" action="create" params="['exemplo.id': exemploInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'comentario.label', default: 'Comentario')])}</g:link>

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataCriacao"><g:message code="exemplo.dataCriacao.label" default="Data Criacao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'dataCriacao', 'errors')}">
                                    <g:formatDate date="${exemploInstance?.dataCriacao}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="denuncias"><g:message code="exemplo.denuncias.label" default="Denuncias" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'denuncias', 'errors')}">
                                    
<ul>
<g:each in="${exemploInstance?.denuncias?}" var="d">
    <li><g:link controller="denuncia" action="show" id="${d.id}">${d?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="denuncia" action="create" params="['exemplo.id': exemploInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'denuncia.label', default: 'Denuncia')])}</g:link>

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="descricao"><g:message code="exemplo.descricao.label" default="Descricao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'descricao', 'errors')}">
                                    <g:textField name="descricao" value="${exemploInstance?.descricao}" />
                                </td>
                            </tr>
                        
                            
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="estilo"><g:message code="exemplo.estilo.label" default="Estilo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'estilo', 'errors')}">
                                    <g:select name="estilo.id" from="${eudjok.Estilo.list()}" optionKey="id" value="${exemploInstance?.estilo?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="legal"><g:message code="exemplo.legal.label" default="Legal" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'legal', 'errors')}">
                                    <g:textField name="legal" value="${fieldValue(bean: exemploInstance, field: 'legal')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="titulo"><g:message code="exemplo.titulo.label" default="Titulo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'titulo', 'errors')}">
                                    <g:textField name="titulo" value="${exemploInstance?.titulo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="ultimaAtualizacao"><g:message code="exemplo.ultimaAtualizacao.label" default="Ultima Atualizacao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: exemploInstance, field: 'ultimaAtualizacao', 'errors')}">
                                    <g:formatDate date="${exemploInstance?.ultimaAtualizacao}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
